﻿using System;
using System.IO;

using Microsoft.WowAddonStudio.Lua.Model;
using Microsoft.WowAddonStudio.Lua.Parser;

namespace Microsoft.WowAddonStudio.Lua.Loaders
{
    public class LuaFileDocumentationLoader : FileDocumentationLoader
    {
        /// <summary>
        /// Loads the documentation from a file.
        /// </summary>
        /// <param name="fileStream">A <see cref="Stream"/> to the file.</param>
        /// <returns>An instance of the <see cref="DocumentationScope"/> class.</returns>
        public override DocumentationScope LoadFileDocumentation(Stream fileStream)
        {
            if (fileStream == null)
                throw new ArgumentNullException("fileStream");

            return DocumentationParser.Parse(fileStream);
        }
    }
}
